<?
session_start();
include 'functions.php';
include 'connect.php';

$output = json_encode(array("status"=>"error", "message"=>"NO"));

$commentId = mysql_real_escape_string($_POST['commentId']);

if(isset($_SESSION['password']) && isset($_SESSION['email']) && isset($_SESSION['userId']) && isset($_POST['commentId'])){

	$password = mysql_real_escape_string($_SESSION['password']);
	$email = mysql_real_escape_string($_SESSION['email']);
	
	$validate = checkUser($email, $password, 1);
	
	if($validate == 1){

		$abfrage = "
			DELETE FROM ffxivc_comments WHERE
				commentid = \"".$commentId."\"";
		$res = mysql_query($abfrage);
			
		if ($res){
			$output = json_encode(array("status"=>"success", "message"=>"DELETE"));
		}
	}
}

echo $output; 

?>